package com.bw.lib_net.interceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * @author ytx
 * @date 2025-09-16 14:38
 * @description 自定义请求头拦截器
 */
class HttpHeadInterceptor: Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val original = chain.request() //获取原始请求

        val requestBuilder = original.newBuilder()
            .addHeader("Content-Language", "")//BuildConfig.I18N_LANG
            .addHeader("platform", "ANDROID")
            .addHeader("source", "CLUB_APP")
            .addHeader("meid",  "")//meid ?: ""
            .addHeader("version", "1.0.0") //BuildConfig.VERSION_NAME
            .addHeader("phoneModel", android.os.Build.BRAND + "_" + android.os.Build.MODEL)
        val request = requestBuilder.build() //构建新的请求
        return chain.proceed(request)
    }
}